<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>付款</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <style>
        .layui-form-item .layui-input-company {
            width: auto;
            padding-right: 10px;
            line-height: 38px;
        }

        .radioItem {
            display: inline-block;
            vertical-align: middle;
            margin-right: 30px;
            margin-top: 15px;
        }

        .radioItem img {
            width: 120px;
            margin-left: -15px;
        }

        .layui-form label {
            font-size: 16px;
            font-weight: bold;
            margin-left: 10px;
            vertical-align: middle;
        }

        .layui-form input {
            width: 1000px;
            margin-left: 35px;
        }
    </style>
</head>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <div class="title" style="font-size: 14px;">
                <p style="font-weight: bold;margin: 15px;font-size: 18px;">选择付款的方式</p>
                <span style="margin: 15px 0 15px 15px;">订单编号：</span><span style="color: rgb(160, 160, 160);"
                    class="order">2022020401</span>
                <span style="font-weight: bold;margin-left: 50px;">您需支付：</span><span
                    style="color: red;font-weight: bold;" id="price">¥20000.00</span>
            </div>

            <div class="layui-form layuimini-form" style="width: 97%;margin:40px 15px 0 15px;">
                <p style="height: 40px;line-height: 40px;background-color: #eeeeee;padding-left: 10px;">支付方式</p>
                <div class="layui-form-item" style="padding-bottom: 10px;width: 1238px;border: 1px solid #ccc;">
                    <div class="layui-input-block" style="margin: 30px;">
                        <div class="radioItem" style="margin-left: -110px;">
                            <input type="radio" name="payway" value="支付宝" title="" checked>
                            <img src="../images/工地中心/支付宝.png" alt="">
                        </div>
                        <div class="radioItem">
                            <input type="radio" name="payway" value="微信支付" title="">
                            <img src="../images/工地中心/微信支付.png" alt="">
                        </div>
                        <div class="radioItem">
                            <input type="radio" name="payway" value="储蓄卡" title="">
                            <img src="../images/工地中心/储蓄卡.png" alt="">
                        </div>
                        <div class="radioItem">
                            <input type="radio" name="payway" value="线下转账" title="线下转账">
                        </div>
                    </div>
                </div>
                <div style="margin-top: -15px;border: 1px solid #ccc;border-top: none;padding-top: 15px;">
                    <div class="layui-form-item">
                        <label class="layui-form-label">收款单位</label>
                        <span
                            style="margin-left: 30px;display:inline-block;height:36px;line-height:36px;">杭州联晶网络科技有限公司</span>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开户银行</label>
                        <span
                            style="margin-left: 30px;display:inline-block;height:36px;line-height:36px;">中国建设银行杭州文晖支行</span>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">银行账号</label>
                        <span
                            style="margin-left: 30px;display:inline-block;height:36px;line-height:36px;">56454456456456456</span>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label required" style="margin-left: 15px;">付款账号<span
                                style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input type="text" name="payID'" lay-verify="required" lay-reqtext="付款账号不能为空" id="payID"
                                placeholder="请输入付款账号" value="" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label required" style="margin-top: 50px;margin-left: 15px;">付款凭证<span
                                style="color: red;">*</span></label>
                        <input class="layui-upload-file" type="file" accept="" name="file">
                        <div class="layui-upload-list"
                            style="display: inline-block;vertical-align: middle;margin:15px 0 15px 20px;width: 200px;height: 100px;border:1px dashed #ccc">
                            <img class="layui-upload-img" id="demo1" style="width: 200px;height: 100px;">
                            <p id="demoText"></p>
                        </div>
                        <button type="button" class="layui-btn layui-btn-primary layui-btn layui-btn-sm" id="upload"
                            style="display: block;margin-left: 145px;margin-bottom: 15px;">
                            <i class="layui-icon">&#xe67c;</i>上传图片
                        </button>
                    </div>
                    <div class="layui-form-item" style="margin-bottom: 30px;">
                        <label class="layui-form-label">备注</label>
                        <div class="layui-input-block">
                            <input type="text" name="moretext'" id="moretext" placeholder="请输入备注" value=""
                                class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn" id="saveBtn"
                                style="position:absolute;right:90px">立即付款</button>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
    <script>
        layui.use(['form', 'jquery', 'miniTab', 'upload'], function () {
            var $ = layui.jquery,
                form = layui.form,
                layer = layui.layer,
                miniTab = layui.miniTab,
                upload = layui.upload;
            var remember = 0; //是否记住密码
            var password = '';
            var username = '';
            var strCookie = document.cookie;
            if (strCookie != '') {
                var arrCookie = strCookie.split("; ");
                for (i = 0; i < arrCookie.length; i++) {
                    var arr = arrCookie[i].split("=");
                    if (arr[0] == 'username')
                        username = arr[1];
                    else if (arr[0] == 'remember')
                        remember = 1;
                    else if (arr[0] == 'password')
                        password = arr[1];
                }
            }
            var url = '';
            var url2 = window.location.href;
            var param = url2.split('?');
            var params = param[1].split('&');
            var mid = params[0].split('=')[1];
            var price = params[1].split('=')[1];
            $('body').ready(function () {
                $('#price').text('¥' + price);
            })
            var uploadInst = upload.render({
                elem: '#upload',
                url: '/users', //改成您自己的上传接口
                size: 10,
                accept: 'images',
                acceptMime: 'image/*',
                auto: false, // 取消自动提交
                bindAction: "#upload", //确认上传按钮
                field: "img", //上传的图片part名称
                choose: function (obj) {
                    //预读本地文件示例，不支持ie8
                    obj.preview(function (index, file, result) {
                        $('#demo1').attr('src', result); //图片链接（base64）
                        url = result;
                        // var a=result.substring(result.indexOf(',') + 1)
                        // url = decodeURIComponent(window.atob(a).replace(/%/g, '%25'));
                        console.log(result);
                    });
                },
                done: function (rs, index, upload) {
                    if (rs.code == 200) {
                        layer.msg("修改成功");
                    }
                },
                error: function (index, upload) {
                    layer.msg("修改失败");
                }
            });
            //监听提交
            form.on('submit(saveBtn)', function (data) {
                data1 = data.field;
                data1.username = username;
                if (url == '')
                    layer.msg('请上传付款凭证！');
                else {
                    var index = layer.alert(JSON.stringify(data.field), {
                        title: '最终的提交信息'
                    }, function () {
                        data1.mode = '2';
                        data1.url = url;
                        layer.msg('支付成功！');
                    });
                }
                return false;

            });
        });
    </script>
</body>

</html>